// pages/work/index.js
var dd=require("../../data/data")
var my=require("../../utils/MyUtils")
const app=getApp()
Page({
  /**
   * 页面的初始数据
   */
  data: {
    list:dd.list,
    user:null
  },
  widgetsToggle: function (e) {
    var id = e.currentTarget.id
    var ids=e.currentTarget.dataset.id
    var list = this.data.list
    for (var i = 0, len = list.length; i < len; ++i) {
      if (list[i].id == id) {
        list[i].open = !list[i].open
      } else {
      }
    }
    this.setData({
      list: list
    })
  },
  onLoad: function (options) {
  },
  onShow:function(){
    wx.hideNavigationBarLoading()
      var _TOKEN=wx.getStorageSync('_TOKEN')
      if(_TOKEN==""){
        my.alerts("您还未登录，请登录之后再操作",function(){
          wx.switchTab({
            url: '../my/my',
          })
        })
      }
  },
  t1:function(res){
    var id=res.currentTarget.dataset.id;
    var url=null
    if(id==11){
      url='../work/daka/index'
    }else if(id==12){
      url='../work/leave/index'
    }else if(id==13){
      url='../work/leaveOut/index'
    }else if(id==16){
      url="../work/repCard/index"
    }else if(id==101){
      url="../../pages/yewu/kqtj/index"
    }else if(id==15){
      url="../work/add/add"
    }else if(id==14){
      url="../work/businessTrip/index"
    }else if(id==17){
      url="qd/out"
    }else if(id==18){
      url="dk/out"
    }
    wx.navigateTo({
      'url':url
    })
  }
})